import 'package:aero_frisbee/app/model/af_home_user_model/af_home_user_model.dart';
import 'package:aero_frisbee/gen/assets.gen.dart';
import 'package:flutter/material.dart';
import 'package:freezed_annotation/freezed_annotation.dart';

part 'cache_bind_video_model.freezed.dart';
part 'cache_bind_video_model.g.dart';

@freezed
class CacheBindVideoModel with _$CacheBindVideoModel {
  factory CacheBindVideoModel({
    String? mediaPath,
    int? type,
    @JsonKey(name: 'home_user') AfHomeUserModel? homeUser,
  }) = _CacheBindVideoModel;

  factory CacheBindVideoModel.fromJson(Map<String, dynamic> json) =>
      _$CacheBindVideoModelFromJson(json);
}

extension CacheBindVideoModelX on CacheBindVideoModel {
  Image get markImg {
    if (type == 0) {
      return Assets.icons.iconHotCornerMark.image(width: 38);
    } else if (type == 1) {
      return Assets.icons.iconLikeCornerMark.image(width: 38);
    } else if (type == 2) {
      return Assets.icons.iconNewCornerMark.image(width: 38);
    } else {
      return Assets.icons.iconNewCornerMark.image(width: 38);
    }
  }
}
